import request from '@/utils/request'
import { apiVersion } from '@/config'

// 全局资源分配
export function getAllResource (data) {
  return request({
      url: `/admin/${apiVersion}/dashboard/global/resource`,
      method: 'get',
       data
  })
}
/**
 * 获取节点网卡分配情况
 * @param {*} data
 */
export function nodeGpuAllocation() {
  return request({
    url: `/admin/${apiVersion}/dashboard/node/gpu/allocation`,
    method: 'get'
  })
}
/**
 * 获取pod资源使用率
 * @param {*} data 
 */
export function usageDuration(data) {
  return request({
    url: `/admin/${apiVersion}/dashboard/pod/usage/duration`,
    noLoadding: true,
    method: 'post',
    data
  })
}
/**
 * 获取pod资源使用率
 * @param {*} data 
 */
export function myNamespace(data) {
  return request({
    url: `/admin/${apiVersion}/organizationConfiguration/myNamespace`,
    noLoadding: true,
    method: 'get',
    data
  })
}
/**
 * 获取存储节点磁盘状态
 * @param {*} data 
 */
export function nfsStatus(data) {
  return request({
    url: `/admin/${apiVersion}/dashboard/storage/nfs/status`,
    noLoadding: true,
    method: 'get',
    data
  })
}
/**
 * 获取当前仿真进程数
 * @param {*} data 
 */
export function simulationCount(data) {
  return request({
    url: `/admin/${apiVersion}/dashboard/simulation/count`,
    noLoadding: true,
    method: 'get',
    data
  })
}
/**
 * 获取网络节点列表
 * @param {*} data 
 */
export function networkNodeAll(data) {
  return request({
    url: `/admin/${apiVersion}/dashboard/network/node/all`,
    noLoadding: true,
    method: 'get',
    data
  })
}
/**
 * 每秒网络带宽使用-折线图
 * @param {*} data 
 */
export function networkUsageDuration(data) {
  return request({
    url: `/admin/${apiVersion}/dashboard/network/usage/duration`,
    noLoadding: true,
    method: 'post',
    data
  })
}
/**
 * 服务器资源总览表
 * @param {*} data 
 */
export function nodeStatus(data) {
  return request({
    url: `/admin/${apiVersion}/dashboard/node/status`,
    noLoadding: true,
    method: 'get',
    data
  })
}
/**
 * 网络带宽使用-当前
 * @param {*} data 
 */
export function networkUsageCurrent(data) {
  return request({
    url: `/admin/${apiVersion}/dashboard/network/usage/current`,
    noLoadding: true,
    method: 'post',
    data
  })
}